<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>第4天JavaScript程序</title>
    <script type="text/javascript">
        var num=prompt("请输入数字：","");
        if(num == 2)
            alert(num + "是素数");
        else {
            var res  = 0;
            for(var i = 2; i < num; i++) {
                if(num % i == 0){
                    alert(num + "不是素数");
                    res++;
                }
            }
            if(res == 0)
                alert(num + "是素数");
        }
        alert("第五个Javascrpit程序。");
        d = new Date();
        document.write(d.toString());
    </script>
</head>
<body></body>
</html>
